package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 盘点单
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_check")
@ApiModel(value = "Check", description = "盘点单")
public class CheckEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 盘点单号
     */
    @ApiModelProperty(value = "盘点单号")
    @NotEmpty(message = "盘点单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "盘点单号长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 货主id
     */
    @ApiModelProperty(value = "货主id")
    @TableField(value = "owner_id")
    private Long ownerId;
    /**
     * 计划盘点时间
     */
    @ApiModelProperty(value = "计划盘点时间")
    @NotNull(message = "计划盘点时间不能为空", groups = {Save.class})
    @TableField(value = "plan_check_time")
    private java.time.LocalDateTime planCheckTime;
    /**
     * 盘点原因 规划:GH、货主:HZ、差异:CY
     */
    @ApiModelProperty(value = "盘点原因 规划:GH、货主:HZ、差异:CY")
    @NotEmpty(message = "盘点原因 规划:GH、货主:HZ、差异:CY不能为空", groups = {Save.class})
    @Length(max = 10, message = "盘点原因 规划:GH、货主:HZ、差异:CY长度不能超过10")
    @TableField(value = "reason")
    private String reason;
    /**
     * 盘点维度 库位:KW、货品:HP
     */
    @ApiModelProperty(value = "盘点维度 库位:KW、货品:HP")
    @NotEmpty(message = "盘点维度 库位:KW、货品:HP不能为空", groups = {Save.class})
    @Length(max = 10, message = "盘点维度 库位:KW、货品:HP长度不能超过10")
    @TableField(value = "dimension")
    private String dimension;
    /**
     * 盘点类型 随机盘点:SJPD、计划盘点:JHPD
     */
    @ApiModelProperty(value = "盘点类型 随机盘点:SJPD、计划盘点:JHPD")
    @NotEmpty(message = "盘点类型 随机盘点:SJPD、计划盘点:JHPD不能为空", groups = {Save.class})
    @Length(max = 10, message = "盘点类型 随机盘点:SJPD、计划盘点:JHPD长度不能超过10")
    @TableField(value = "type")
    private String type;
    /**
     * 仓库id
     */
    @ApiModelProperty(value = "仓库id")
//    @NotNull(message = "仓库id不能为空", groups = {Save.class})
    @TableField(value = "warehouse_id")
    private Long warehouseId;
    /**
     * 库区id
     */
    @ApiModelProperty(value = "库区id")
    @TableField(value = "area_id")
    private Long areaId;
    /**
     * 盘点单状态 1新建、2一盘中、3一盘完成、4复盘中、5复盘完成、6已取消
     */
    @ApiModelProperty(value = "盘点单状态 1新建、2一盘中、3一盘完成、4复盘中、5复盘完成、6已取消")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
